Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix!: Code refactoring to patch broken local dev setup #646

Merged
merged 6 commits into from
Jan 10, 2024
Merged

Conversation

nevoodoo
Copy link
Collaborator

@nevoodoo nevoodoo commented Jan 10, 2024

Description

This addresses issues related to the local environment setup by skipping any Bearer token assignment or connection to GCP. Running the project with SM_ENVIRONMENT=LOCAL was raising auth-related GCPClient errors as the project looked for GCP credentials. Technically, this shouldn't be necessary when running locally.

Changes Made

Refactored graphql/init.py for Local Environment Handling:

Modified metamist/graphql/__init__.py file:
When running locally, the AIOHTTPTransport instance is created without the Authorization header.
This modification prevents unnecessary authentication-related errors that were occurring during local execution.

Modified the openapi-templates/configuration.mustache template:
Updated the OpenAPI configuration.mustache template to accommodate local environment nuances.
Specifically, the auth_settings class method now returns an empty auth object when the application is running locally.

@codecov-commenter
Copy link

codecov-commenter commented Jan 10, 2024

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (7087297) 69.74% compared to head (37ac4f6) 69.72%.

Files Patch % Lines
metamist/graphql/__init__.py 40.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #646      +/-   ##
==========================================
- Coverage   69.74%   69.72%   -0.03%     
==========================================
  Files         121      121              
  Lines        9691     9697       +6     
==========================================
+ Hits         6759     6761       +2     
- Misses       2932     2936       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@illusional illusional left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, great work!
Can you add more description to the PR and PR title to describe the functional output of the change?

The linting has also flagged:

trim trailing whitespace.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook

Fixing metamist/graphql/__init__.py
Fixing openapi-templates/configuration.mustache

Then, great to merge!

@nevoodoo nevoodoo changed the title Fixed local use fix!: Code refactoring to patch broken local dev setup Jan 10, 2024
@nevoodoo nevoodoo merged commit 674d1f1 into dev Jan 10, 2024
2 checks passed
@nevoodoo nevoodoo deleted the fix-local-use branch January 10, 2024 03:54
@illusional illusional mentioned this pull request Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants